<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/echarts.min.js"></script>
</head>
<body>
<div id="main" style="width:650px; height:410px"></div>
<div id="main1" style="width:650px; height:410px"></div>
<div id="main2" style="width:650px; height:410px"></div>
<script type="text/javascript">
    var myCharts=echarts.init(document.getElementById('main'));
    myCharts.setOption({
        tooltip: {
            show: true,
            formatter: '{b} {c}'
        },
        grid: {
            left: '20%',
            top: '8%',
            bottom: '10%',
            right: '5%'
        },
        xAxis: [
            {
                max: 100,
                type: 'value',
                splitNumber: 10,
                axisTick: {
                    show: false,
                },
                axisLine: {
                    show: true,
                },
                axisLabel: {
                    show: true,
                    formatter:'{value}%',
                },
                splitLine: {
                    show: true
                }
            }
        ],
        yAxis: [
            {
                type: 'category',
                data:  ['周一','周二','周三','周四','周五','周六','周日'],
                nameTextStyle: {
                    color: '#b7ce9e',
                    fontSize: '18px'
                },
                axisTick: {
                    show: false,
                },
                axisLine: {
                    show: false,
                }
            }
        ],
        series: [
            {
                name: ' ',
                type: 'bar',
                color: '#18d6b9',
                barWidth: 8,
                label: {
                    normal: {
                        show: true,
                        position: 'right',
                        formatter: '{c}%',
                    }
                },
                itemStyle: {
                    normal: {
                        color: '#18d6b9'
                    }
                },
                data: [15, 80, 20, 60, 90, 30, 40],
                markLine: {
                    label: {
                        normal: {
                            show: true,
                            position: 'end',
                            formatter: '{b}{c}%'
                        }
                    },
                    lineStyle: {
                        normal: {
                            color: '#525d63'
                        }
                    },
                    symbol: 'none',
//                data: [
//                  {name: '平均值为', xAxis: vm.avgledge}
//                ]
                }
            }
        ]
    })

//    第二个图
    var myCharts1=echarts.init(document.getElementById('main1'));
    myCharts1.setOption({
        color:['#ffc688', '#ffada8', '#fce16b', '#cbc9ff', '#97f3be'],
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        legend: {
            data: ['直接访问', '邮件营销','联盟广告','视频广告','搜索引擎']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis:  {
            type: 'value'
        },
        yAxis: {
            type: 'category',
            data: ['周一','周二','周三','周四','周五','周六','周日']
        },
        series: [
            {
                name: '直接访问',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [320, 302, 301, 334, 390, 330, 320]
            },
            {
                name: '邮件营销',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [120, 132, 101, 134, 90, 230, 210]
            },
            {
                name: '联盟广告',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [220, 182, 191, 234, 290, 330, 310]
            },
            {
                name: '视频广告',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [150, 212, 201, 154, 190, 330, 410]
            },
            {
                name: '搜索引擎',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [820, 832, 901, 934, 1290, 1330, 1320]
            }
        ]
    })

//    第三个图
    var myCharts2=echarts.init(document.getElementById('main2'));
    myCharts2.setOption({
        color:['#FFC688','#aff2f2', '#f2afe5'],
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        legend: {
            data:['利润', '支出', '收入']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis : [
            {
                type : 'value'
            }
        ],
        yAxis : [
            {
                type : 'category',
                axisTick : {show: false},
                data : ['周一','周二','周三','周四','周五','周六','周日']
            }
        ],
        series : [
            {
                name:'利润',
                type:'bar',
                label: {
                    normal: {
                        show: true,
                        position: 'inside'
                    }
                },
                data:[200, 170, 240, 244, 200, 220, 210]
            },
            {
                name:'收入',
                type:'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true
                    }
                },
                data:[320, 302, 341, 374, 390, 450, 420]
            },
            {
                name:'支出',
                type:'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'left'
                    }
                },
                data:[-120, -132, -101, -134, -190, -230, -210]
            }
        ]
    })
</script>

</body>
</html>